// JavaScript Document


$(function(){
	
		//评分插件
    $("#vote").sexyVote();


})

function showPmDialog(thisa)
{	
	$('#pm_dialog').css('display','block');
	if($('#pm_dialog').dialog('isOpen'))return false;	
	
	var asrc = $(thisa).attr('href');
	var atitle = $(thisa).attr('title');	
	
	/*$('#pm_dialog').ready(
		function(){		*/
			$("#pm_dialog").dialog(
			{
				position:'center',
				title:atitle,
				width:'500px',
				height:'380px',
				resizable: false,
				modal:true,
				overlay: { 
					opacity: 0.5, 
					background: "black" 
				}
				
			}
			);
	/*	}
	)*/
	$('#pm_dialog > iframe').attr('src',asrc);
	$('#pm_dialog').dialog('open');
	return false;
}
function addFavor(targetUid,typeid,type){
		$.post("<?=$this->url(array('module'=>'default','action'=>'index','controller'=>'favor'),'default'); ?>",{targetUid:targetUid,typeid:typeid,type:type},
		   function(data){
		   alert(data);
		});	
}

//评分
function score(touid,scoreType,userType,points){
		$.post("<?=$this->url(array('module'=>'default','action'=>'index','controller'=>'score'),'default'); ?>",{touid:touid,scoreType:scoreType,userType:userType,points:points},
		   function(data){
		   alert(data);
		});	
}

function addFriend(targetUid,type){
		$.post("<?=$this->url(array('module'=>'default','action'=>'index','controller'=>'friend'),'default'); ?>",{targetUid:targetUid,type:type},
		   function(data){
		   alert(data);
		});	
}

function getReplys(page,rid,uid,type){
	$("#itemReplyBox").html("Loading...");
	$.post('<?=$this->urls('guestbook','index','default',array(),'guestbooknav'); ?><?php echo $this->baseUrl; ?>?type='+type+'&rid='+rid+'&page='+page,{}, function(data) {
			$("#itemReplyBox").html(data);			
			});
}
